﻿using System;
using System.Linq;
using Zeus.Interop.SampleSite.Models;

namespace Zeus.Interop.SampleSite.Stubs
{
    public class StaticData : IRepository
    {
        public IQueryable<Customer> Customers
        {
            get
            {
                return new[]
                {
                    new Customer {Id = 1, FirstName = "John", LastName = "Smith"},
                    new Customer {Id = 2, FirstName = "Jane", LastName = "Doe"},
                    new Customer {Id = 2, FirstName = "David", LastName = "Hasselhoff"},

                }.AsQueryable();
            }
        }

        public IQueryable<Product> Products
        {
            get
            {
                return new[]
                   {
                       new Product
                           {
                               Id = 1,
                               Name = "Dragonsword",
                               Description = "Either a sword for a dragon or the word of many dragons"
                           },

                       new Product
                           {
                               Id = 2,
                               Name = "Moonwand",
                               Description = "Magic missle wand"
                           },

                   }.AsQueryable();
            }
        }

        public IQueryable<Order> Orders
        {
            get
            {
                return new[]
                       {
                           new Order
                               {
                                   Id = 1,
                                   CustomerId = 1,
                                   OrderDate = new DateTime(2009, 1, 1),
                                   Items = new[]
                                               {
                                                   new OrderItem {Id = 1, OrderId = 1, ProductId = 1, QtyOrdered = 1},
                                                   new OrderItem {Id = 2, OrderId = 1, ProductId = 2, QtyOrdered = 2},
                                               }
                               },
                           new Order
                               {
                                   Id = 2,
                                   CustomerId = 1,
                                   OrderDate = new DateTime(2010, 1, 1),
                                   Items = new[]
                                               {
                                                   new OrderItem {Id = 3, OrderId = 2, ProductId = 1, QtyOrdered = 1},
                                               }
                               },
                           new Order
                               {
                                   Id = 3,
                                   CustomerId = 2,
                                   OrderDate = new DateTime(2010, 5, 10),
                                   Items = new[]
                                               {
                                                   new OrderItem {Id = 4, OrderId = 3, ProductId = 2, QtyOrdered = 3},
                                               }
                               },

                       }.AsQueryable();
            }
        }
    }
}